# coding:utf-8
from django.apps import AppConfig
import os

VERBOSE_APP_NAME = u"用户管理"


def get_current_app_name(_file):
    return os.path.split(os.path.dirname(_file))[-1]


class UsersConfig(AppConfig):
    name = get_current_app_name(__file__)
    verbose_name = VERBOSE_APP_NAME

    def ready(self):
        from allauth.account.signals import user_logged_in, user_signed_up
        from .receivers import update_joined, update_last_login

        user_signed_up.connect(update_joined)
        user_logged_in.connect(update_last_login)
